Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: OLE Calls to CorelDRAW from LotusScript Agent
~Umberto Nongeroson 17.Oct.02 11:15 PM a Web browser
Domino Designer All Releases All Platforms


It might be worth asking in a CorelDraw forum rather than here, since it looks to be more of a Corel issue than a Notes issue. I suspect you'd have the same problem if you did this in VB.

At a guess, I'd say it might possibly work better if you were very careful to always set your OLE objects to Nothing before exiting the script. I've found this often helps clean up leftover processes and reclaim lost memory when using OLE and COM with other applications, but I haven't tried Corel.

Here's a tip: to make certain you always set an object to Nothing even if the code exits abnormally (e.g. from a user pressing Crtl+Break), create a wrapper class that uses the Delete method to set the variable to Nothing when the object is deallocated.
Class OLEWrapper
	OLEobj As Variant

	Sub New(eObj)
		Set OLEObj = eObj
	End Sub

	' Make obj a read-only property to prevent messing with it.
	' So call me paranoid.
	Public Property Get obj( )
		Set obj = OLEObj
	End Property

	Sub Delete
		Set OLEobj = Nothing
	End Sub
End Class

...

Dim App As New OLEWrapper(CreateObject("CorelDraw.Application.10"))
...
Set cdrDoc = New OLEWrapper(cdrApp.obj.CreateDocumentFromTemplate("C:\SomeTemplate.cdt", True))


and so on.





OLE Calls to CorelDRAW from LotusSc... (~Tip Nontumiman... 17.Oct.02)
. . RE: OLE Calls to CorelDRAW from Lot... (~Bill Frokimari... 17.Oct.02)
. . . . RE: OLE Calls to CorelDRAW from Lot... (~Tip Nontumiman... 18.Oct.02)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS